/**
 * 
 */
package com.dp.behav.util.observer;

import java.util.Observable;

/**
 * @author Sunaina.Sharma
 * 
 */
public class WeatherDetails extends Observable {
	private float temperature;
	private float humidity;

	WeatherDetails() {

	}

	/**
	 * This method is invoked when there is change in measurements
	 */
	public void measurementsChanged() {
		// This signify that the state has changed.
		setChanged();
		// If you want to "push" data to observers you can pass the data as a
		// data object [notifyObserver(arg)]. If not then the Observer has to
		// "pull" the data from the Observable object passed to it
		notifyObservers();
	}

	/**
	 * @param temp
	 * @param humid
	 */
	public void setMeasurements(float temp, float humid) {
		this.temperature = temp;
		this.humidity = humid;
		measurementsChanged();
	}

	/**
	 * @return the temperature
	 */
	public float getTemperature() {
		return temperature;
	}

	/**
	 * @param temperature
	 *            the temperature to set
	 */
	public void setTemperature(float temperature) {
		this.temperature = temperature;
	}

	/**
	 * @return the humidity
	 */
	public float getHumidity() {
		return humidity;
	}

	/**
	 * @param humidity
	 *            the humidity to set
	 */
	public void setHumidity(float humidity) {
		this.humidity = humidity;
	}

}
